﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Text;

/// <summary>
///Class1 的摘要说明
/// </summary>
/// 

//class PageBase : System.Web.UI.Page

public class gy
{
    public string DisplayStr()
    {
        string biaoid = "101000";
        SqlConnection sqlcon = new SqlConnection();
        sqlcon.ConnectionString = ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString;
        sqlcon.Open();

        SqlCommand sqlcmd1 = new SqlCommand("select * from tishi where substring(tishiid,1,6)='" + biaoid + "'", sqlcon);
        //reader.Close();
        //sqlcon.Open();
        SqlDataReader reader1 = sqlcmd1.ExecuteReader(CommandBehavior.CloseConnection);
        string joinstr = "[";
        while (reader1.Read())
        {
            joinstr = joinstr + "{'tishiid':'" + reader1["tishiid"].ToString() + "','idmingcheng':'" + reader1["idmingcheng"].ToString() + "','ti1':'" + reader1["ti1"].ToString() + "','ti2':'" + reader1["ti2"].ToString() + "','ti3':'" + reader1["ti3"].ToString() + "'},";
        }

        joinstr = joinstr.Substring(0, joinstr.Length - 1);
        joinstr = joinstr + "]";

        //TextBox99.Text = joinstr;
        reader1.Close();
        sqlcon.Close();

        return joinstr;
    }

}